import { DataGridProps, DataGridColumn, RowNumberOptions } from '@farris/ui-vue';
import { data } from '../../../demo-data';

export default function (dataGridSchema: any): DataGridProps {
    const columns: DataGridColumn[] = [
        { field: 'id', title: '标识', width: 60, resizable: true, dataType: 'string', readonly: true },
        { field: 'avatar', title: '头像', width: 100, resizable: true, dataType: 'string', readonly: true },
        { field: 'code', title: '编号', width: 80, resizable: true, dataType: 'string' },
        { field: 'name', title: '名称', width: 80, resizable: true, dataType: 'string' },
        { field: 'fullName', title: '全称', width: 80, resizable: true, dataType: 'string' },
        { field: 'status', title: '状况', width: 80, resizable: true, dataType: 'string' },
        { field: 'description', title: '说明', width: 80, resizable: true, dataType: 'text' },
        { field: 'booleanField1', title: '布尔字段一', width: 100, resizable: true, dataType: 'boolean' },
        { field: 'booleanField2', title: '布尔字段二', width: 100, resizable: true, dataType: 'boolean' },
        { field: 'dateField1', title: '日期字段一', width: 100, resizable: true, dataType: 'datetime' },
        { field: 'dateField2', title: '日期字段二', width: 100, resizable: true, dataType: 'datetime' },
        { field: 'datetimeField1', title: '时间字段一', width: 180, resizable: true, dataType: 'datetime' },
        { field: 'datetimeField2', title: '时间字段二', width: 160, resizable: true, dataType: 'datetime' },
        { field: 'enumField1', title: '枚举字段一', width: 120, resizable: true, dataType: 'string' },
        { field: 'enumField2', title: '枚举字段二', width: 100, resizable: true, dataType: 'number' },
        { field: 'numericField1', title: '数字字段一', width: 100, resizable: true, dataType: 'number' },
        { field: 'numericField2', title: '数字字段二', width: 100, resizable: true, dataType: 'number' },
        { field: 'customField1', title: '自定义字段一', width: 120, resizable: true, dataType: 'string' },
        { field: 'customField2', title: '自定义字段二', width: 120, resizable: true, dataType: 'string' },
        { field: 'customField3', title: '自定义字段三', width: 100, resizable: true, dataType: 'string' }
    ];

    const pagination = {
        enable: true,
        size: 20
    };

    const rowNumberOption: RowNumberOptions = {
        enable: true,
        width: 32,
        heading: '序号'
    };

    const selectionOption = {
        multiSelect: true,
        showCheckbox: true
    };

    const rowOption = {
        wrapContent: false
    };

    return { columns, data, pagination, rowNumberOption, selectionOption, rowOption };
}
